-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
71 lines (65 loc) · 1.98 KB
/
test.html
File metadata and controls
71 lines (65 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Headless Vanilla UI Test</title>
<style>
body { font-family: system-ui, sans-serif; padding: 2rem; }
/* Tabs styling */
[data-slot="tabs-list"] {
display: flex;
gap: 0.5rem;
border-bottom: 1px solid #ccc;
margin-bottom: 1rem;
}
[data-slot="tabs-trigger"] {
padding: 0.5rem 1rem;
border: none;
background: none;
cursor: pointer;
border-bottom: 2px solid transparent;
}
[data-slot="tabs-trigger"][data-state="active"] {
border-bottom-color: blue;
font-weight: bold;
}
[data-slot="tabs-content"] {
padding: 1rem;
background: #f5f5f5;
border-radius: 4px;
}
</style>
</head>
<body>
<h1>@data-slot Test</h1>
<div data-slot="tabs" id="my-tabs" data-default-value="one">
<div data-slot="tabs-list">
<button data-slot="tabs-trigger" data-value="one">Tab One</button>
<button data-slot="tabs-trigger" data-value="two">Tab Two</button>
<button data-slot="tabs-trigger" data-value="three">Tab Three</button>
</div>
<div data-slot="tabs-content" data-value="one">
<h2>Content One</h2>
<p>This is the first tab content.</p>
</div>
<div data-slot="tabs-content" data-value="two">
<h2>Content Two</h2>
<p>This is the second tab content.</p>
</div>
<div data-slot="tabs-content" data-value="three">
<h2>Content Three</h2>
<p>This is the third tab content.</p>
</div>
</div>
<script type="module">
import { create, createTabs } from './src/tabs/index.ts'
// Auto-discover and bind all tabs
const controllers = create()
console.log('Controllers:', controllers)
console.log('Initial value:', controllers[0]?.value)
// Programmatic control example
window.selectTab = (value) => controllers[0]?.select(value)
</script>
</body>
</html>