react-toolbox/components/link/readme.md

29 lines
1.4 KiB
Markdown
Raw Normal View History

2015-07-06 13:53:37 +03:00
# Link
2015-11-01 11:14:36 +03:00
The link is a very simple component that acts mostly as a wrapper for the HTML anchor. It's not included in Material Design Specification but we provide it as an easy way to create links with icons and counters. Let's see an example:
<!-- example -->
```jsx
import Link from 'react-toolbox/lib/link';
2015-07-06 13:53:37 +03:00
2015-11-01 11:14:36 +03:00
const LinksTest = () => (
<nav>
<Link active href="/#/components/link" label="Work" count={4} icon='business' />
2015-12-20 20:48:17 +03:00
<Link href="/#/components/link" label="Blog" icon='speaker_notes' />
2015-11-01 11:14:36 +03:00
<Link href="/#/components/link" label="Explore" icon='explore' />
</nav>
);
2015-07-06 13:53:37 +03:00
```
## Properties
2015-11-01 11:14:36 +03:00
You can add as many properties as you want to be directly transferred to the output anchor element. Apart from them you have the following properties:
| Name | Type | Default | Description|
2015-11-01 11:14:36 +03:00
|:-----|:-----|:-----|:-----|
| `active` | `Boolean` | `false` | If true, adds active style to link.|
| `className` | `String` | `''` | Sets a custom class name to add styles to the link.|
| `count` | `Number` | | Sets a count number.|
| `icon` | `String` or `Element` | | An icon key string to include a `FontIcon` component in front of the text.|
| `label` | `String` | | The text string used for the text content of the link.|