react-toolbox/components/link
Javi Velasco badc0cb277 Merge branch 'dev' of github.com:soyjavi/react-toolbox into dev
* 'dev' of github.com:soyjavi/react-toolbox:
  Restructure typescript definitions (#1114)
  Enable dynamic source for single value Autocomplete (#1120)
  Add suggestionMatch option to disable filtering (#1122)
  Expose onEscKeyDown on Drawer component (#1150)
  Add inverse to <MenuIcon /> (#1147)
  Added proper type definitions for dialog actions so typescript users can pass on props to the generated buttons (#1098)
  Remove diacritic signs in query and suggestions (#1115)
  Update Button README.md (#1081)
  feat(a11y): add alt attribute to set alternative text for the icon or image (#1102)
  Add backers and Sponsors (#1137)
2017-01-18 11:03:30 +01:00
..
Link.d.ts Restructure typescript definitions (#1114) 2017-01-18 08:37:37 +01:00
Link.js Better PropType syntax and delete required className api 2016-06-03 23:44:33 +02:00
index.d.ts Restructure typescript definitions (#1114) 2017-01-18 08:37:37 +01:00
index.js Migrate styles to PostCSS (#666) 2017-01-05 02:42:18 +01:00
readme.md Autoinject theme for Link 2016-05-29 20:03:41 +02:00
theme.css Fixes #1127 2017-01-18 10:56:03 +01:00

readme.md

Link

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:

import Link from 'react-toolbox/lib/link';

const LinksTest = () => (
  <nav>
    <Link active href="/#/components/link" label="Work" count={4} icon='business' />
    <Link href="/#/components/link" label="Blog" icon='speaker_notes' />
    <Link href="/#/components/link" label="Explore" icon='explore' />
  </nav>
);

If you want to provide a theme via context, the component key is RTLink.

Properties

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
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.

Theme

Name Description
active Added to the root element if the Link is active.
icon Used for the icon element if it's present.
link Used for the root element.