-
Notifications
You must be signed in to change notification settings - Fork 51
Website: add section on single file components to "Getting started for engineers" #3349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just submitted one minor suggested edit but other than that looks good!
Co-authored-by: Kristin Bradley <[email protected]>
|
|
||
| ### Single file components | ||
|
|
||
| If you are are using single file components (ie., `.gts` or `.gjs` files), the components need to be individually imported into the file for them to render. All components can be imported from the `@hashicorp/design-system-components/components` path. To use a component's signature, you must import it from the definition file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| If you are are using single file components (ie., `.gts` or `.gjs` files), the components need to be individually imported into the file for them to render. All components can be imported from the `@hashicorp/design-system-components/components` path. To use a component's signature, you must import it from the definition file. | |
| If you are are using single file components (i.e., `.gts` or `.gjs` files), the components need to be individually imported into the file for them to render. All components can be imported from the `@hashicorp/design-system-components/components` path. To use a component's signature, you must import it from the definition file. |
See: https://www.wikihow.com/Use-i.e.-in-a-Sentence for more info
|
|
||
| interface MyComponentSignature { | ||
| Args: {}; | ||
| Element: HdsFormTextInputFieldSignature; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be like this?
| Element: HdsFormTextInputFieldSignature; | |
| Element: HdsFormTextInputFieldSignature['Element']; |
|
|
||
| const MyComponent: TOC<MyComponentSignature> = <template> | ||
| <HdsFormTextInputField ...attributes as |F|> | ||
| <F.Label>Name</F.Label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[suggestion] how about we make the Name an argument?
📌 Summary
PREVIEW
If merged, this PR would add a short blurb on how to use Helios components in SFCs.
Note: the syntax highlighting is definitely not perfect, this is a limitation of Prism as they don't have a gts/gjs highlighter. This can be addressed more holistically when we decide to add gts snippets to the component docs pages.
📸 Screenshots
🔗 External links
Jira ticket: HDS-5583
💬 Please consider using conventional comments when reviewing this PR.
📋 PCI review checklist
Examples of changes to controls include access controls, encryption, logging, etc.
Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.