HTML Elements
The @dnb/eufemia
contains styling for the most commonly used HTML Elements defined by the UX team at DNB. You may also have a look at Typography for headings and paragraph usage.
Elements
- Blockquote: The blockquote element is used to indicate the quotation of a large section of text from another source.
- Code
- Heading: The heading element is used to indicate the quotation of a large section of text from another source.
- Hr-line (Divider): The
<hr />
tag in HTML stands for horizontal rule and is used to insert a horizontal rule or a thematic break in an HTML page to divide or separate document sections. - Image
- Ingress
- Lead
- Lists
- Paragraph
- Span
Vanilla HTML
In order to apply a style, you have to define a CSS class, like:
<a href="/" className="dnb-anchor">Text Link</a><blockquote className="dnb-blockquote">Dis leo ala tractatos ei quo.</blockquote>
React JSX
For those using JSX with React, you can simply use the wrapper Components. They also inherit to the Skeleton provider.
import { H1, H2, P, Anchor, Link } from '@dnb/eufemia'render(<article><H1>Semantic h1</H1><P>My Paragraph</P><Anchor href="/">Link</Anchor><Link href="/">Link</Link></article>,)
Styled Components
They work seamlessly with Styled Components (emotion) as well:
Code Editor
const StyledLink = styled(Link)` color: var(--color-fire-red); ` render( <StyledLink href="/" target="_blank"> Styled Link </StyledLink>, )
Unstyled HTML Elements
In order to use the inherited Skeleton, there are a number of un-styled HTML elements, that do inherit and react to the Skeleton Provider.
import { Span, Div } from '@dnb/eufemia'
Span
Div