New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

t1-web-components

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

t1-web-components

High-quality dark mode component library built with Vue 3 + TypeScript + Tailwind 3

latest
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

T1 Web Components

A high-quality dark mode component library built with Vue 3 + TypeScript + Tailwind 3. Features intelligent Camel Case search highlighting and premium dark aesthetics.

Core Features

  • 🌙 Dark Mode: Native support for dark styles with a high-quality dark color palette.
  • 🔍 Camel Case Search: Supports fast filtering via uppercase letter combinations (e.g., searching VC for VueComponent).
  • 💡 Yellow Highlighting: Search results highlight matching characters in yellow (text-yellow-400).
  • ⌨️ Keyboard Support: Full logic for arrow key selection and Enter key confirmation.

Installation

# Using pnpm
pnpm install t1-web-components

Quick Start

1. Import Tailwind CSS

Include Tailwind in your style file (ensure tailwindcss v3 is installed):

@tailwind base;
@tailwind components;
@tailwind utilities;

2. Use Components

<script setup>
import { DropDownList, AutoComplete, JsonEditor } from 't1-web-components'
import { ref } from 'vue'

const selected = ref('')
const options = [
  { label: 'Vue.js', value: 'vue' },
  { label: 'TypeScript', value: 'ts' }
]

const jsonData = ref('[{"id":1,"name":"John"}]')
const schema = [
  { key: 'id', label: 'ID', type: 'number' as const },
  { key: 'name', label: 'Name', type: 'string' as const }
]
</script>

<template>
  <div class="dark p-8 bg-gray-900 min-h-screen text-white">
    <DropDownList
      v-model="selected"
      :options="options"
      placeholder="Select an option..."
    />

    <JsonEditor
      v-model="jsonData"
      :schema="schema"
    />
  </div>
</template>

Component API

DropDownList

A dropdown selector that enforces selection from the provided list.

Props

Prop NameTypeDefaultDescription
modelValuestring | number''Binding value (v-model)
optionsArray<{label, value}>[]List of options
placeholderstring'Please select...'Input placeholder text
inputClassstring''Custom CSS class for the input

Events

  • @update:modelValue: Triggered when the selected value changes.

AutoComplete

An autocomplete component that allows free-text input.

Props

Prop NameTypeDefaultDescription
modelValuestring | number''Binding value (v-model)
optionsArray<string | {text, value}>[]List of suggestions
placeholderstring''Input placeholder text
inputClassstring''Custom CSS class for the input

Events

  • @update:modelValue: Triggered when the input or selection changes.
  • @change: Triggered when a list item is selected, returns the item object.

JsonEditor

A dynamic JSON data editor that supports both array and object editing modes. Automatically detects the mode based on input and provides a rich editing experience.

Props

Prop NameTypeDefaultDescription
modelValuestring | nullnullBinding value (v-model) - must be a JSON string
schemaJsonSchemaField[][]Field definitions (must use as const for type)
compactbooleanfalseOutput compact format (single line) when true

Schema Definition

Each field in the schema must follow this structure:

interface JsonSchemaField {
  key: string                          // Field key
  label?: string                       // Display label (optional)
  type: 'string' | 'number' | 'date'  // Field type
}

Important: Use as const assertion for proper type inference:

const schema = [
  { key: 'id', label: 'ID', type: 'number' as const },
  { key: 'name', label: 'Name', type: 'string' as const },
  { key: 'createdAt', label: 'Created At', type: 'date' as const }
]

Events

  • @update:modelValue: Triggered when the JSON string changes.
  • @change: Triggered when data is modified.
  • @error: Triggered when JSON parsing fails, returns error message.

Modes

JsonEditor automatically switches between two modes based on the input:

Array Mode (input: [...])

  • Displays data as a table
  • Features: Search, Add, Edit, Delete, Insert, Delete All
  • Changes are saved immediately

Object Mode (input: {...})

  • Displays data as a form
  • Features: Edit fields, Save/Cancel buttons
  • Changes require clicking Save to update

Empty Input (input: "" or null)

  • Initializes a form based on schema
  • Defaults to Object Mode

Usage Example

Array Mode Example:

<script setup>
import { JsonEditor } from 't1-web-components'
import { ref } from 'vue'

const arrayData = ref('[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]')
const schema = [
  { key: 'id', label: 'ID', type: 'number' as const },
  { key: 'name', label: 'Name', type: 'string' as const }
]
</script>

<template>
  <JsonEditor
    v-model="arrayData"
    :schema="schema"
    :compact="false"
  />
</template>

Object Mode Example:

<script setup>
import { JsonEditor } from 't1-web-components'
import { ref } from 'vue'

const objectData = ref('{"id":1,"name":"John","email":"john@example.com"}')
const schema = [
  { key: 'id', label: 'ID', type: 'number' as const },
  { key: 'name', label: 'Name', type: 'string' as const },
  { key: 'email', label: 'Email', type: 'string' as const }
]
</script>

<template>
  <JsonEditor
    v-model="objectData"
    :schema="schema"
  />
</template>

Initialize from Empty:

<script setup>
import { JsonEditor } from 't1-web-components'
import { ref } from 'vue'

const data = ref('')
const schema = [
  { key: 'username', label: 'Username', type: 'string' as const },
  { key: 'age', label: 'Age', type: 'number' as const }
]
</script>

<template>
  <JsonEditor
    v-model="data"
    :schema="schema"
  />
</template>

License

MIT LICENSE

Keywords

vue

FAQs

Package last updated on 10 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts