mirror of https://github.com/MaxLeiter/Drift
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			21 lines
		
	
	
		
			352 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			21 lines
		
	
	
		
			352 B
		
	
	
	
		
			TypeScript
		
	
// https://www.joshwcomeau.com/snippets/react-components/shift-by/
 | 
						|
type Props = {
 | 
						|
	x?: number
 | 
						|
	y?: number
 | 
						|
	children: React.ReactNode
 | 
						|
}
 | 
						|
 | 
						|
function ShiftBy({ x = 0, y = 0, children }: Props) {
 | 
						|
	return (
 | 
						|
		<div
 | 
						|
			style={{
 | 
						|
				transform: `translate(${x}px, ${y}px)`,
 | 
						|
				display: "inline-block"
 | 
						|
			}}
 | 
						|
		>
 | 
						|
			{children}
 | 
						|
		</div>
 | 
						|
	)
 | 
						|
}
 | 
						|
export default ShiftBy
 |