Text Pressure(004)

Variable font weight and optical sizing that react dynamically to cursor proximity.

Hover
Loading…

Installation

$npx kibo add text-pressure

Usage

1import { TextPressure } from "@/components/kibo/text-pressure/component";
2
3export default function MyComponent() {
4 return (
5 <div className="relative h-[200px] w-full">
6 <TextPressure
7 text="INTERACT"
8 flex={true}
9 width={true}
10 weight={true}
11 textColor="#ffffff"
12 />
13 </div>
14 );
15}

Props Reference

PropTypeDefaultDescription
textstring"Compressa"The text to display.
fontFamilystring"Roboto Flex"The Google Font family to use.
fontUrlstring"https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wdth,wght@8..144,25..151,100..1000&display=swap"The URL to the Google Font.
widthbooleantrueWhether to adjust font width based on cursor.
weightbooleantrueWhether to adjust font weight based on cursor.
italicbooleantrueWhether to adjust italic slant based on cursor.
alphabooleanfalseWhether to adjust opacity based on cursor.
flexbooleantrueWhether to use flexbox spacing.
strokebooleanfalseWhether to render a stroke effect instead of solid text.
scalebooleanfalseWhether to scale text to fill container height.
textColorstring"#FFFFFF"Base text color.
strokeColorstring"#FF0000"Stroke color if stroke is true.
strokeWidthnumber2Stroke width in pixels if stroke is true.
classNamestring""Additional CSS classes.
minFontSizenumber24Minimum font size in pixels.