ChildrenWithIcon / Dev
Install
Import
Usage with ref
There are two ways to use refs in this component depending on if you provide a custom tag or not (see the previous section).
Use the elementRef
-prop for all cases where you do not provide a custom tag. When you do pass a custom tag, simply
use the ref
directly on the custom component/tag in the render-method as shown in the following example:
👨💻 Override the tag of the component
All button components defaults to a <button>
-tag. However, it's common to
change this to an <a>
-tag (anchor-tag) for semantic purposes or use a third party component
like the <Link />
-component from react-router-dom. In any case,
this is accomplished by using the render
-prop. Like shown in the code example below.
All props -- including the children
-- gets past down as an argument, making it easy
to spoon-feed props to your custom component.
Props
ButtonLoading
Prop | Type & Description |
---|
ChildrenWithIcon
Prop | Type & Description |
---|---|
size | ButtonSizes Changes the appearance of the button including spacing and text. There are four sizes:
The |
children | ReactNode Any valid ReactNode(s) |