# Strike Through

An animated hand-drawn line for striking through a word or phrase.

Element page: [https://www.remotion.dev/elements/text/strike-through/](https://www.remotion.dev/elements/text/strike-through/)

## Installation

Install this Element into a composition of your Remotion project:

```sh
npx remotion elements use https://www.remotion.dev/elements/text/strike-through/ --composition <composition-id> --yes
```

Replace `<composition-id>` with the ID of the composition to add the Element to. The command installs the dependencies, downloads the assets, writes the source file and adds the Element to the composition. See [`npx remotion elements use`](https://www.remotion.dev/docs/cli/elements/use.md).

## Manual installation

To install the Element manually instead, save the source below as `strike-through.element.tsx` in your Remotion project and import its exported component.

## Source

```tsx
import {loadFont} from '@remotion/google-fonts/CormorantGaramond';
import {StrikeThrough} from '@remotion/rough-notation';
import React from 'react';
import {
	Interactive,
	interpolate,
	useCurrentFrame,
	type InteractiveTransformProps,
} from 'remotion';

const {fontFamily} = loadFont('normal', {
	weights: ['700'],
	subsets: ['latin'],
});

const StrikeThroughTextInner: React.FC<InteractiveTransformProps> = ({
	style,
}) => {
	const frame = useCurrentFrame();

	return (
		<Interactive.Div
			name="Container"
			showInTimeline={false}
			style={{
				display: 'flex',
				alignItems: 'center',
				justifyContent: 'center',
				height: '100%',
				fontSize: 80,
				fontWeight: 700,
				lineHeight: 1.1,
				color: '#171717',
				fontFamily,
				...style,
			}}
		>
			<div>
				<Interactive.Span>The </Interactive.Span>
				<StrikeThrough
					name="Strike-through annotation"
					progress={interpolate(frame, [10, 25], [0, 1], {
						extrapolateLeft: 'clamp',
						extrapolateRight: 'clamp',
					})}
					color="#f11515"
					strokeWidth={14}
				>
					forbidden
				</StrikeThrough>{' '}
				<Interactive.Span>fruit</Interactive.Span>
			</div>
		</Interactive.Div>
	);
};

export const StrikeThroughText = Interactive.create({
	Component: StrikeThroughTextInner,
	componentName: '<StrikeThroughText>',
});
```

