Skip to Content
🎉 Coral x Panda has been released 🎉 Read the Migration Guide
DocumentationAtomsSkipToContent

SkipToContent

An internal navigation component that help users move around a page.

Basic Usage

import { SkipToContent } from '@krakentech/coral'; const CONTENT_ID = 'main-content'; <SkipToContent id={CONTENT_ID} /> <main id={CONTENT_ID}>Main content</main>

Click here and then press tab to activate the SkipToContent atom.

Properties

id

Declare a constant for the ID, which can be used as a prop for both the Element and the SkipToContent component.

const CONTENT_ID = 'alternative-id'; <SkipToContent id={CONTENT_ID} />

label

<SkipToContent id={CONTENT_ID} label="Alternative label" />

Full API

NameTypeDefault
attributesAttributes

This prop can be used to pass HTML attributes directly to the component. We currently allow passing data-* and aria-* attributes and the id. However, you can pass anything else with a type hack if necessary since this object is despread in to the component, without filtering its content.

Example usage:

AttributesProps: { 'id': 'close-button', 'aria-label': 'Close button', 'data-testid': 'close-button' };
loadingboolean

To be used with children. If true, the skeleton is visible. Once false, the children are faded in.

true
fadeInDurationnumber

The fadeIn duration in seconds. Requires loading toggled to false in order to see the transition.

0.5
animationResponsiveVariant<ConditionalValue<"pulse" | "wave"> | undefined>

The type of animation. Set as undefined disable.

pulse
variantResponsiveVariant<ConditionalValue<"text" | "rounded" | "circular" | "rectangular"> | undefined>

The variant of the skeleton to use.

text
heightResponsiveVariant<string | number>

Height of the skeleton.

widthResponsiveVariant<string | number>

Width of the skeleton.

aria-labelstring | undefined

A hidden screen-reader label to describe to the user what the skeleton is for.

childrenReactNode
Last updated on