Code Snippet

Code snippet is used to display code or commands for user to copy and paste.

#

Grant read access
gcloud projects add-iam-policy-binding project_id \
--member serviceAccount:test@test.com \
--role roles/storage.objectViewer
import { CodeSnippet } from "@hightouchio/ui";

<CodeSnippet
label="Grant read access"
code={`
gcloud projects add-iam-policy-binding project_id \\
--member serviceAccount:test@test.com \\
--role roles/storage.objectViewer
`}
/>;

#

#

Grant read access
gcloud projects add-iam-policy-binding project_id \
--member serviceAccount:test@test.com \
--role roles/storage.objectViewer
import { CodeSnippet } from "@hightouchio/ui";

<CodeSnippet
label="Grant read access"
code={`
gcloud projects add-iam-policy-binding project_id \\
--member serviceAccount:test@test.com \\
--role roles/storage.objectViewer
`}
/>;

#

gcloud projects add-iam-policy-binding project_id \
--member serviceAccount:test@test.com \
--role roles/storage.objectViewer
import { CodeSnippet } from "@hightouchio/ui";

<CodeSnippet
code={`
gcloud projects add-iam-policy-binding project_id \\
--member serviceAccount:test@test.com \\
--role roles/storage.objectViewer
`}
/>;

#

gcloud projects add-iam-policy-binding project_id \
--member serviceAccount:test@test.com \
--role roles/storage.objectViewer
import { CodeSnippet } from "@hightouchio/ui";

<CodeSnippet
code={`
gcloud projects add-iam-policy-binding project_id \\
--member serviceAccount:test@test.com \\
--role roles/storage.objectViewer
`}
hasCopyButton={false}
/>;

#

NameDefaultDescription
code

string

Code snippet.

label

string

Label to show above the code snippet.

hasCopyButtontrueboolean

Whether to show a copy button.