Socket
Book a DemoInstallSign in
Socket

@ar-dacity/ardacity-text-pressure

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ar-dacity/ardacity-text-pressure

Dynamic text pressure effects for React applications

latest
npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

ArDacity Text Pressure

A React component library that adds dynamic pressure effects to text using variable fonts.

Installation

npm install @ar-dacity/ardacity-text-pressure

or

yarn add @ar-dacity/ardacity-text-pressure

What Happens During Installation

When you install this package, it automatically:

  • Creates a components/ArDacityUi directory in your project (if it doesn't exist)
  • Creates a TextPressure subdirectory
  • Copies the TextPressure component files into that directory:
    • TextPressure.jsx
    • index.js

Usage

After installation, you can import the component directly from your components directory:

import TextPressure from './components/ArDacityUi/TextPressure/TextPressure';
// Or simply:
import { TextPressure } from './components/ArDacityUi/TextPressure';

function App() {
  return (
    <div style={{position: 'relative', height: '300px'}}>
      <TextPressure
        text="Ardacity!"
        flex={true}
        alpha={false}
        stroke={false}
        width={true}
        weight={true}
        italic={true}
        textColor="#ffffff"
        strokeColor="#ff0000"
        minFontSize={36}
      />
    </div>
  );
}

Component Props

PropertyTypeDefaultDescription
textstring"ardacity"Text content that will be displayed and animated.
fontFamilystring"ardacity VF"Name of the variable font family.
fontUrlstring(ardacity font URL)URL for the variable font file (needed)
flexbooleantrueWhether the characters are spaced using flex layout.
scalebooleanfalseIf true, vertically scales the text to fill its container height.
alphabooleanfalseIf true, applies an opacity effect based on cursor distance.
strokebooleanfalseIf true, adds a stroke effect around characters.
widthbooleantrueIf true, varies the variable-font "width" axis.
weightbooleantrueIf true, varies the variable-font "weight" axis.
italicbooleantrueIf true, varies the variable-font "italics" axis.
textColorstringautoThe fill color of the text. Automatically adapts to light/dark themes when not specified.
strokeColorstring"#FF0000"The stroke color that will be applied to the text when "stroke" is set to true
strokeWidthnumber2The width of the stroke in pixels
classNamestring""Additional class for styling the <h1> wrapper.
minFontSizenumber24Sets a minimum font-size to avoid overly tiny text on smaller screens.

Important Notes

  • Make sure the font you're using supports all the variable properties you enable.
  • The component works best with variable fonts that support width, weight, and italic axes.
  • For best results, place the TextPressure component in a container with a defined height.
  • The default font is provided as an example and should not be used in commercial projects.
  • If no textColor is specified, the component will automatically detect the theme and use black text on light backgrounds and white text on dark backgrounds.

Example: Customizing the Font

<TextPressure
  text="Custom Font"
  fontFamily="My Variable Font"
  fontUrl="https://example.com/path/to/my-variable-font.woff2"
  width={true}
  weight={true}
  italic={false}
  textColor="#000000"
/>

Example: Minimal Usage

You can also use the component with minimal configuration:

<TextPressure/>

This will render the component with all default settings and automatic text color based on theme.

Compatibility

This package is compatible with:

  • React 16.8.0 and above (requires Hooks)
  • React with JSX
  • Vite projects
  • Next.js projects
  • Create React App projects

License

MIT

Keywords

react

FAQs

Package last updated on 23 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts