File tree Expand file tree Collapse file tree 3 files changed +98
-0
lines changed
components/contentSeparator Expand file tree Collapse file tree 3 files changed +98
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Component: ContentSeparator
3
+ *
4
+ * A labeled horizontal divider with the message centered between two lines.
5
+ * Useful for visually separating groups of content within a page.
6
+ *
7
+ * Props overview
8
+ * - message: string — text shown in the label (required)
9
+ * - variant: 'neutral' | 'info' | 'warning' | 'success' | 'danger' (default 'info')
10
+ * - marginTopRem, marginBottomRem: control vertical spacing (defaults 2 / 1)
11
+ *
12
+ * Usage
13
+ * <ContentSeparator message="Advanced configuration" />
14
+ */
15
+ type Props = {
16
+ /** The message displayed in the center label. */
17
+ message : string ;
18
+ /** Extra spacing below (in rem). Default: 1. */
19
+ marginBottomRem ?: number ;
20
+ /** Extra spacing above (in rem). Default: 2. */
21
+ marginTopRem ?: number ;
22
+ /** Optional visual style; default 'info'. */
23
+ variant ?: 'neutral' | 'info' | 'warning' | 'success' | 'danger' ;
24
+ } ;
25
+
26
+ import styles from './style.module.scss' ;
27
+
28
+ /**
29
+ * ContentSeparator
30
+ *
31
+ * A labeled horizontal separator that sits between content blocks.
32
+ * Example:
33
+ * <ContentSeparator message="Advanced configuration" />
34
+ */
35
+ export function ContentSeparator ( {
36
+ message,
37
+ variant = 'info' ,
38
+ marginTopRem = 2 ,
39
+ marginBottomRem = 1 ,
40
+ } : Props ) {
41
+ return (
42
+ < section
43
+ className = { styles . wrapper }
44
+ style = { { marginTop : `${ marginTopRem } rem` , marginBottom : `${ marginBottomRem } rem` } }
45
+ >
46
+ < div className = { styles . separator } role = "separator" aria-label = { message } >
47
+ < span className = { styles . line } aria-hidden = "true" />
48
+ < span className = { `${ styles . label } ${ styles [ `label--${ variant } ` ] } ` } >
49
+ { message }
50
+ </ span >
51
+ < span className = { styles . line } aria-hidden = "true" />
52
+ </ div >
53
+ </ section >
54
+ ) ;
55
+ }
Original file line number Diff line number Diff line change
1
+ .wrapper {}
2
+
3
+ .separator {
4
+ display : flex ;
5
+ align-items : center ;
6
+ gap : 0.75rem ;
7
+ width : 100% ;
8
+ }
9
+
10
+ .line {
11
+ flex : 1 1 auto ;
12
+ height : 1px ;
13
+ background : var (--gray-a5 );
14
+ }
15
+
16
+ .label {
17
+ display : inline-flex ;
18
+ align-items : center ;
19
+ padding : 0.35rem 0.75rem ;
20
+ border-radius : 6px ;
21
+ font-weight : 500 ;
22
+ font-size : 0.95rem ;
23
+ color : #fff ;
24
+ background : var (--code-background );
25
+ border : 1px solid var (--accent-11 );
26
+ box-shadow : 0 1px 2px var (--gray-a3 );
27
+ max-width : 66.6667% ;
28
+ flex : 0 1 66.6667% ;
29
+ text-align : center ;
30
+ justify-content : center ;
31
+ white-space : normal ;
32
+ }
33
+
34
+ .label--neutral {}
35
+ .label--info { background : var (--accent-a3 , var (--gray-a3 )); border-color : var (--accent-a6 , var (--gray-a6 )); }
36
+ .label--success { background : var (--green-a3 , var (--gray-a3 )); border-color : var (--green-a6 , var (--gray-a6 )); }
37
+ .label--warning { background : var (--yellow-a3 , var (--gray-a3 )); border-color : var (--yellow-a6 , var (--gray-a6 )); }
38
+ .label--danger { background : var (--red-a3 , var (--gray-a3 )); border-color : var (--red-a6 , var (--gray-a6 )); }
39
+
40
+ .content { margin-top : 1rem ; }
41
+
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import {CodeTabs} from './components/codeTabs';
8
8
import { CommunitySupportedPlatforms } from './components/communitySupportedPlatforms' ;
9
9
import { ConfigKey } from './components/configKey' ;
10
10
import { ConfigValue } from './components/configValue' ;
11
+ import { ContentSeparator } from './components/contentSeparator' ;
11
12
import { CreateGitHubAppForm } from './components/createGitHubAppForm' ;
12
13
import { DefinitionList } from './components/definitionList' ;
13
14
import { DevDocsCardGrid } from './components/devDocsCardGrid' ;
@@ -59,6 +60,7 @@ export function mdxComponents(
59
60
Card,
60
61
CliChecksumTable,
61
62
CommunitySupportedPlatforms,
63
+ ContentSeparator,
62
64
DevDocsCardGrid,
63
65
PlatformFilter,
64
66
CodeBlock,
You can’t perform that action at this time.
0 commit comments