Typographytypographylabellayout
Floating Label
Badge label with floating bounce animation.
Live Preview
PREMIUMFloating Label
Usage
Copy and paste this code into your React component:
tsx
import { FloatingTextLabel } from 'react-component-kit-ui/typography';
<FloatingTextLabel>Content</FloatingTextLabel>Manual Installation
If you are not using the npm package, create a new file and paste the following code: src/components/FloatingTextLabel.tsx + FloatingTextLabel.css:
FloatingTextLabel.tsx
'use client';
import type { ReactNode } from 'react';
import './FloatingTextLabel.css';
/** FloatingTextLabel โ ported from astro-component-kit. */
export interface FloatingTextLabelProps {
children?: ReactNode;
}
export function FloatingTextLabel({ children }: FloatingTextLabelProps) {
return (
<>
<div className="f-label-wrap" data-rk-f9cb2b="">
<span className="f-label" data-rk-f9cb2b="">PREMIUM</span>
{children}
</div>
</>
);
}
export default FloatingTextLabel;FloatingTextLabel.css
/* FloatingTextLabel โ ported from astro-component-kit (typography/FloatingTextLabel.astro) */
.f-label-wrap:where([data-rk-f9cb2b]) { position: relative; padding-top: 1.5rem; }
.f-label:where([data-rk-f9cb2b]) { position: absolute; top: 0; left: 0; font-size: 0.7rem; font-weight: 800; color: #6366f1; letter-spacing: 0.2em; text-transform: uppercase; }Quick Info
- Category
- Typography
- Filename
FloatingTextLabel.tsx- Dependencies
- None โ pure React + CSS
- Tags
- typographylabellayout