Debian Codegraph @

node/@patternfly/react-core/src/components/SkipToContent/SkipToContent.tsx

raw
1 import styles from '@patternfly/react-styles/css/components/SkipToContent/skip-to-content';
2 import { css } from '@patternfly/react-styles';
3 import { Button, ButtonVariant } from '../Button';
4
5 export interface SkipToContentProps extends React.HTMLProps<HTMLDivElement> {
6 /** The skip to content link. */
7 href: string;
8 /** Content to display within the skip to content component, typically a string. */
9 children?: React.ReactNode;
10 /** Additional styles to apply to the skip to content component. */
11 className?: string;
12 }
13
14 export const SkipToContent: React.FunctionComponent<SkipToContentProps> = ({
15 children = null,
16 className = '',
17 href,
18 ...props
19 }: SkipToContentProps) => (
20 <div className={css(styles.skipToContent, className)} {...props}>
21 <Button variant={ButtonVariant.primary} component="a" href={href}>
22 {children}
23 </Button>
24 </div>
25 );
26
27 SkipToContent.displayName = 'SkipToContent';