Skip to content

Commit a5ff5d5

Browse files
committed
add vue example
1 parent 1f8f573 commit a5ff5d5

File tree

16 files changed

+203
-39
lines changed

16 files changed

+203
-39
lines changed

examples/with-solid/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# React
1+
# SolidJS
22

3-
This is a bare-bones example to demonstrate how to use USWDS Elements in a React project.
3+
This is a bare-bones example to demonstrate how to use USWDS Elements in a SolidJS project.

examples/with-sveltekit/README.md

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,3 @@
1-
# sv
1+
# SvelteKit
22

3-
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
4-
5-
## Creating a project
6-
7-
If you're seeing this, you've probably already done this step. Congrats!
8-
9-
```sh
10-
# create a new project in the current directory
11-
npx sv create
12-
13-
# create a new project in my-app
14-
npx sv create my-app
15-
```
16-
17-
## Developing
18-
19-
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20-
21-
```sh
22-
npm run dev
23-
24-
# or start the server and open the app in a new browser tab
25-
npm run dev -- --open
26-
```
27-
28-
## Building
29-
30-
To create a production version of your app:
31-
32-
```sh
33-
npm run build
34-
```
35-
36-
You can preview the production build with `npm run preview`.
37-
38-
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
3+
This is a bare-bones example to demonstrate how to use USWDS Elements in a SvelteKit project.

examples/with-vue/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar"]
3+
}

examples/with-vue/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Vue
2+
3+
This is a bare-bones example to demonstrate how to use USWDS Elements in a Vue project.

examples/with-vue/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>with-vue</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

examples/with-vue/package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "with-vue",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vue-tsc -b && vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"@uswds/elements": "1.0.0-alpha.4",
13+
"vue": "^3.5.24"
14+
},
15+
"devDependencies": {
16+
"@types/node": "^24.10.0",
17+
"@vitejs/plugin-vue": "^6.0.1",
18+
"@vue/tsconfig": "^0.8.1",
19+
"typescript": "~5.9.3",
20+
"vite": "^7.2.2",
21+
"vue-tsc": "^3.1.3"
22+
}
23+
}

examples/with-vue/public/vite.svg

Lines changed: 1 addition & 0 deletions
Loading

examples/with-vue/src/App.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!-- src/App.vue -->
2+
<script setup lang="ts">
3+
import { UsaBanner } from "@uswds/elements";
4+
</script>
5+
6+
<template>
7+
<usa-banner></usa-banner>
8+
<h1>My Vue App</h1>
9+
</template>

examples/with-vue/src/main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { createApp } from "vue";
2+
import "./style.css";
3+
import App from "./App.vue";
4+
5+
createApp(App).mount("#app");

0 commit comments

Comments
 (0)