Typographytypographyeditorialparagraph
Drop Cap Paragraph
Editorial paragraph with styled drop cap first letter.
Live Preview
Drop Cap Paragraph
Usage
Copy and paste this code into your React component:
tsx
import { DropCapParagraph } from 'react-component-kit-ui/typography';
<DropCapParagraph>Content</DropCapParagraph>Manual Installation
If you are not using the npm package, create a new file and paste the following code: src/components/DropCapParagraph.tsx + DropCapParagraph.css:
DropCapParagraph.tsx
'use client';
import type { ReactNode } from 'react';
import './DropCapParagraph.css';
/** DropCapParagraph โ ported from astro-component-kit. */
export interface DropCapParagraphProps {
children?: ReactNode;
}
export function DropCapParagraph({ children }: DropCapParagraphProps) {
return (
<>
<p className="drop-p" data-rk-1c2ef5="">{children}</p>
</>
);
}
export default DropCapParagraph;DropCapParagraph.css
/* DropCapParagraph โ ported from astro-component-kit (typography/DropCapParagraph.astro) */
.drop-p:where([data-rk-1c2ef5]) { color: #94a3b8; line-height: 1.8; font-size: 1.1rem; }
.drop-p:where([data-rk-1c2ef5])::first-letter { float: left; font-size: 4rem; font-weight: 900; line-height: 0.8; margin-right: 0.5rem; margin-top: 0.5rem; color: #fff; background: linear-gradient(135deg, #6366f1, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }Quick Info
- Category
- Typography
- Filename
DropCapParagraph.tsx- Dependencies
- None โ pure React + CSS
- Tags
- typographyeditorialparagraph