Example of Hints - default
<div> <h5 class="bc-h5"> Become a researcher </h5> <BcHint as='div'> Already have an account? <a className='bc-helper-block' href='/user/sign_up'> Log in </a> </BcHint> </div>
React documentation
Last modified:
Hints are subdued text style used for secondary or tertiary text. Use hints to style additional instructions or descriptive text in forms.
BcHint Props
This component inherits following React elements: ReactChild | ReactChild[] | ReactChildren | ReactChildren[]
.
Prop | Type | Required? | Default | Description |
---|---|---|---|---|
children | JSX | required | Accepts JSX to wrap the html inside BcHint parent component. | |
as | string | optional | span | Switch between either <span> or <div> or <p> tag (span is default). |
display | string | optional | Sets respective helper class for the CSS display property (eg inline , inlineblock , and block ). | |
className | string | optional | Sets custom css class. | |
size | string | optional | Switch between different sizes like small or large. |
Any extended types:
React.HTMLAttributes<HTMLSpanElement>
forspan
React.HTMLAttributes<HTMLDivElement>
fordiv
React.HTMLAttributes<HTMLParagraphElement>
forp
HTML
Last modified:
Intended to be used as a wrapper, eg. on a div
or an aside
wrapping some p
paragraphs.
Design
Last modified:
Hints help users visually scan a page and identify ancillary content.
The “subdued” visual style of a “lighter” text color and size is juxtaposed against the default (darker and larger) or the stronger font-weight of form Labels or small headings.
Accessibility
Last modified:
When adding descriptive text for especially form inputs it’s important to make a relationship between them.
Start by adding a unique ID to the Hint block.
Next use the aria-describedby
attribute set on the described input with the value being the ID of the Hint block.
Rationale
Last modified:
Hints are an important part of our visual typographic hierarchy to help users quickly identify primary, secondary, and ancillary content.
See also
Last modified: