package.src.components.CodeBlock.CodeBlock.tsx Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react-core Show documentation
Show all versions of react-core Show documentation
This library provides a set of common React components for use with the PatternFly reference implementation.
The newest version!
import * as React from 'react';
import styles from '@patternfly/react-styles/css/components/CodeBlock/code-block';
import { css } from '@patternfly/react-styles';
export interface CodeBlockProps extends React.HTMLProps {
/** Content rendered inside the code block */
children?: React.ReactNode;
/** Additional classes passed to the code block wrapper */
className?: string;
/** Actions in the code block header. Should be wrapped with CodeBlockAction. */
actions?: React.ReactNode;
}
export const CodeBlock: React.FunctionComponent = ({
children = null,
className,
actions = null,
...props
}: CodeBlockProps) => (
{actions && (
{actions}
)}
{children}
);
CodeBlock.displayName = 'CodeBlock';