An open API service indexing awesome lists of open source software.

https://github.com/sambecker/use-typing-headlines

React hook designed to display animated headlines
https://github.com/sambecker/use-typing-headlines

Last synced: 12 months ago
JSON representation

React hook designed to display animated headlines

Awesome Lists containing this project

README

          

[![npm version](https://badge.fury.io/js/use-typing-headlines.svg)](https://badge.fury.io/js/use-typing-headlines)

# 💻 useTypingHeadlines

React hook designed to display animated headlines

## Installation

```
npm install use-typing-headlines
```

## Usage

### One headline

One headline preview

```tsx
import { useTypingHeadlines } from 'use-typing-headlines';

const Component = () => {
const [headline] = useTypingHeadlines([
'First you see this',
'Then you see this',
'Lastly, this',
]);

return

{headline}

;
}
```

### Multiple headlines

Two headlines preview

```tsx
const Component = () => {
const [headlineOne] = useTypingHeadlines([
'Peanut Butter',
'Copy',
'Barb',
'Arts',
]);

const [headlineTwo] = useTypingHeadlines([
'Jelly',
'Paste',
'Star',
'Crafts',
]);

return


{headlineOne} &

{headlineTwo}_

;
}
```

### Accessibility (BETA)

```tsx
const Component = () => {
const [headlineLive, headlineStatic] = useTypingHeadlines([
'This text will be tranlated for screen readers',
'Updating one full word at a time ...',
]);

return <>


{headlineLive}



{headlineStatic}
;
>;
}
```