File tree Expand file tree Collapse file tree 4 files changed +74
-0
lines changed
content/docs/style-guide/components Expand file tree Collapse file tree 4 files changed +74
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ import { z } from " astro:schema" ;
3+
4+ type Props = z .infer <typeof props >;
5+
6+ const props = z
7+ .object ({
8+ text: z .string (),
9+ })
10+ .strict ();
11+
12+ const { text } = props .parse (Astro .props );
13+ ---
14+
15+ <span class =" text-xs align-middle" >{ text } </span >
Original file line number Diff line number Diff line change 1+ ---
2+ import { z } from " astro:schema" ;
3+ import { Badge } from " @astrojs/starlight/components" ;
4+
5+ type Props = z .infer <typeof props >;
6+
7+ const props = z
8+ .object ({
9+ text: z .string (),
10+ })
11+ .strict ();
12+
13+ const { text } = props .parse (Astro .props );
14+ ---
15+
16+ <Badge
17+ text ={ text }
18+ size =" small"
19+ style ={ {
20+ color: " var(--sl-text-white)" ,
21+ backgroundColor: " var(--sl-color-gray-6)" ,
22+ borderColor: " var(--sl-color-gray-3)" ,
23+ fontSize: " 0.7rem" ,
24+ fontWeight: " bold" ,
25+ }}
26+ />
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export { default as LinkTitleCard } from "./LinkTitleCard.astro";
2626export { default as ListExamples } from "./ListExamples.astro" ;
2727export { default as ListTutorials } from "./ListTutorials.astro" ;
2828export { default as Markdown } from "./Markdown.astro" ;
29+ export { default as MetaInfo } from "./MetaInfo.astro" ;
2930export { default as NetworkMap } from "./NetworkMap.astro" ;
3031export { default as PagesBuildEnvironment } from "./PagesBuildEnvironment.astro" ;
3132export { default as PagesBuildEnvironmentLanguages } from "./PagesBuildEnvironmentLanguages.astro" ;
@@ -48,6 +49,7 @@ export { default as Stream } from "./Stream.astro";
4849export { default as ThreeCardGrid } from "./ThreeCardGrid.astro" ;
4950export { default as TroubleshootingList } from "./TroubleshootingList.astro" ;
5051export { default as TunnelCalculator } from "./TunnelCalculator.astro" ;
52+ export { default as Type } from "./Type.astro" ;
5153export { default as WorkersAIModels } from "./WorkersAIModels.astro" ;
5254export { default as WorkersArchitectureDiagram } from "./WorkersArchitectureDiagram.astro" ;
5355export { default as WorkersIsolateDiagram } from "./WorkersIsolateDiagram.astro" ;
Original file line number Diff line number Diff line change 1+ ---
2+ title : Type highlighting
3+ description : Components for styling type information for CLI/function parameters.
4+ ---
5+
6+ ## Type
7+
8+ ``` mdx live
9+ import { Type } from " ~/components" ;
10+
11+ <Type text = " Promise<T | string | ArrayBuffer>" />
12+ ```
13+
14+ ## MetaInfo
15+
16+ ``` mdx live
17+ import { MetaInfo } from " ~/components" ;
18+
19+ <MetaInfo text = " (default: false) optional" />
20+ ```
21+
22+ ## Combined example
23+
24+ ``` mdx live
25+ import { Type , MetaInfo } from " ~/components" ;
26+
27+ - ` name ` <Type text = " string" />
28+ - The name of your service.
29+ - ` local ` <Type text = " boolean" /> <MetaInfo text = " (default: true) optional" />
30+ - If the service should run locally or not.
31+ ```
You can’t perform that action at this time.
0 commit comments