Skip to content
Patternfly Logo

Code block

Info alert:Beta feature

This Beta component is currently under review and is still open for further evolution. It is available for use in product. Beta components are considered for promotion on a quarterly basis. Please join in and give us your feedback or submit any questions on the PatternFly forum or via Slack.

Examples

Basic

apiVersion: helm.openshift.io/v1beta1/
kind: HelmChartRepository
metadata:
name: azure-sample-repo
spec:
connectionConfig:
url: https://raw.githubusercontent.com/Azure-Samples/helm-charts/master/docs

Expandable

apiVersion: helm.openshift.io/v1beta1/
kind: HelmChartRepository
metadata:
name: azure-sample-repo

Props

CodeBlock

*required
NameTypeDefaultDescription
actionsReact.ReactNodenullActions in the code block header. Should be wrapped with CodeBlockAction.
childrenReact.ReactNodenullContent rendered inside the code block
classNamestringAdditional classes passed to the code block wrapper

CodeBlockAction

*required
NameTypeDefaultDescription
childrenReact.ReactNodenullContent rendered inside the code block action
classNamestringAdditional classes passed to the code block action

CodeBlockCode

*required
NameTypeDefaultDescription
childrenReact.ReactNodenullCode rendered inside the code block

CSS variables

.pf-c-code-block--pf-c-code-block--BackgroundColor
#f0f0f0
.pf-c-code-block--pf-c-code-block__header--BorderBottomWidth
1px
.pf-c-code-block--pf-c-code-block__header--BorderBottomColor
#d2d2d2
.pf-c-code-block--pf-c-code-block__content--PaddingTop
1rem
.pf-c-code-block--pf-c-code-block__content--PaddingRight
1rem
.pf-c-code-block--pf-c-code-block__content--PaddingBottom
1rem
.pf-c-code-block--pf-c-code-block__content--PaddingLeft
1rem
.pf-c-code-block--pf-c-code-block__pre--FontFamily
'"Liberation Mono", consolas, "SFMono-Regular", menlo, monaco, "Courier New", monospace'
.pf-c-code-block--pf-c-code-block__pre--FontSize
0.875rem

View source on GitHub