Skip to content

Hashtag

Displays a hashtag label with optional click/link behavior. Shows hover effect when interactive.

Also known as: tag link, topic link, hash link, keyword

View in Storybook

When to use

  • Displaying clickable hashtags in posts, profiles, or feeds.
  • Linking to topic/tag pages.
  • Showing static topic labels.

Import

tsx
import { Hashtag } from '@vacano/ui'

Usage (static)

tsx
<Hashtag>React</Hashtag>
// Renders: #React

Clickable

When onClick is provided, shows pointer cursor and blue hover color.

tsx
<Hashtag onClick={() => navigate('/tags/react')}>React</Hashtag>

When href is provided, renders as an <a> element.

tsx
<Hashtag href="/tags/react">React</Hashtag>

Group of hashtags

tsx
<div style={{ display: 'flex', gap: 12 }}>
  <Hashtag onClick={handleClick}>FrontendWithZoey</Hashtag>
  <Hashtag onClick={handleClick}>React</Hashtag>
  <Hashtag onClick={handleClick}>OpenSource</Hashtag>
</div>

Props

PropTypeDefaultDescription
childrenReactNoderequiredTag text (without #, added automatically)
hrefstring-Link URL (renders as <a>)
refRef<HTMLSpanElement>-Forwarded ref
classNamestring-CSS class name for the root element
classnamesHashtagClassNames-Custom class names for sub-elements

ClassNames

KeyDescription
hashThe # symbol
labelThe tag text
  • Chip - Inline label with optional delete
  • Tags - Tag input component

Released under the MIT License.