3.0.0 • Published 6 months ago
@lg-chat/rich-links v3.0.0
Rich Links
View on MongoDB.design
Installation
Yarn
yarn add @lg-chat/rich-linksNPM
npm install @lg-chat/rich-linksProperties
Base Properties
All RichLink components support the following props:
| Prop | Type | Description | Default |
|---|---|---|---|
children | string | The text that shows on the rich link | |
imageUrl | string? | A URL for the background image of the rich link | |
variant | Variant | Render as a built-in Rich Link Variant | |
badgeGlyph | GlyphName | A @leafygreen-ui/icon glyph to show in the badge | |
badgeLabel | string \| React.ReactNode | A string or component to show in the badge | |
badgeColor | "green" \| "gray" \| "blue" \| "purple" \| "red" \| "yellow" | The background color of the badge | "gray" |
...anchorProps | HTMLAnchorElement? | Additional props to spread on the anchor element |
Variants
You can choose from a set of pre-defined variants for a specific use case. For example, the "Docs" variant has a specific color and badge text to ensure consistency across all documentation links.
To use a variant, specify it in the variant prop.
<RichLink href="https://www.example.com" variant="Website">
Example Link
</RichLink>The following variants are supported:
"Blog""Code""Book""Docs""Learn""Video""Website"
Custom Badge
If an existing variant does not meet your use case, you can define a custom
badge instead. To use a custom badge, omit the variant prop and instead
define the badge props:
<RichLink
href="https://www.example.com"
badgeGlyph="ArrowRight"
badgeLabel="My Link"
badgeColor="blue"
>
Example Link
</RichLink>3.0.0
6 months ago
2.0.3
10 months ago
2.0.2
10 months ago
2.0.5
9 months ago
2.0.4
10 months ago
2.0.11
7 months ago
2.0.7
9 months ago
2.0.12
6 months ago
2.0.6
9 months ago
2.0.9
8 months ago
2.0.10
8 months ago
2.0.8
8 months ago
2.0.1
10 months ago
2.0.0
11 months ago
1.2.0
1 year ago
1.1.1
1 year ago
1.1.0
1 year ago
1.0.1
2 years ago
1.0.0
2 years ago