Demos
Anchor states
Code Editor
<Example> <Anchor href="/uilib/components/anchor">Default Style</Anchor> </Example> <Example> <Anchor href="/uilib/components/anchor" className="dnb-anchor--hover"> Hover Style </Anchor> </Example> <Example> <Anchor href="/uilib/components/anchor" className="dnb-anchor--active"> Active Style </Anchor> </Example> <Example> <Anchor href="/uilib/components/anchor" className="dnb-anchor--focus"> Focus Style </Anchor> </Example>
Additional Anchor helper classes
To force a specific state of style, use the following classes to do so:
Anchor modifiers
.dnb-anchor--no-animation
No Animation.dnb-anchor--no-style
No Style.dnb-anchor--no-hover
No Hover.dnb-anchor--no-underline
No Underline
Anchor with icons
Icons can be added with the icon
and iconPosition
props. Normally by sending in the name if an icon, but it is also possible to send in html/react code (normally for custom svg).
target="_blank"
Anchor with If the link opens a new window it will automatically get an icon to indicate this.
Unless the href contains :mailto
, :tel
or :sms
.
Anchor in headings
Anchor in Section
Code Editor
<Section spacing> <Anchor className="dnb-anchor--no-underline" href="https://dnb.no/"> Anchor in Section without underline </Anchor> </Section>