3.0.3 • Published 5 months ago

react-slugify v3.0.3

Weekly downloads
2,706
License
MIT
Repository
github
Last release
5 months ago

react-slugify

Build status

Slugify a React node.

Usage

slugify(node[, options])

  • node String, Number, Fragment, Array of nodes
  • options Object (optional)
    • delimiter String (default is '-')
    • prefix String (default is '')

Examples

import slugify from 'react-slugify';

slugify('something I want to test');
// -> "something-i-want-to-test"

slugify(<span>Yes it works like that too</span>);
// -> "yes-it-works-like-that-too"

slugify(
  <>
    <span>and</span>
    <span>with</span>
    <span>fragments or arrays</span>
  </>
);
// -> "and-with-fragments-or-arrays"

slugify(<h3>Crème brulée receipe</h3>, { delimiter: '_' });
// -> creme_brulee_receipe

slugify(<h3>Crème brulée receipe</h3>, { prefix: 'user-content' });
// -> user-content-creme-brulee-receipe

slugify(<h3>Crème brulée receipe</h3>, {
  delimiter: '_',
  prefix: 'user-content',
});
// -> user-content_creme_brulee_receipe
3.0.3

5 months ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.1.0

2 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago