zanwei GitHub avatar

claude-model-selector

zanwei

A zero-dependency Web Component that provides a Claude-inspired effort picker with six discrete levels, magnetic drag, and keyboard support.

Stars

21

7-day growth

No data

Forks

4

Open issues

0

License

MIT

Last updated

2026-07-10

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It demonstrates how to build a polished, animated UI component with minimal dependencies, using modern web standards like Web Components, Shadow DOM, and Canvas 2D.

Who it is for

  • Web developers building custom UI components
  • Developers seeking inspiration for Claude-like interfaces
  • Users interested in zero-dependency Web Components
  • Designers exploring effort-based level selectors

Use cases

  • Integrating an effort level selector into web apps
  • Prototyping Claude-inspired interfaces
  • Learning Web Component development patterns
  • Creating accessible, animated UI elements

Strengths

  • Zero-dependency, self-contained Web Component
  • Supports keyboard, focus, Escape/outside-click, and prefers-reduced-motion
  • Customizable appearance via CSS variables
  • Emits standard input/change events with detailed payload

Considerations

  • Not affiliated with or endorsed by Anthropic
  • Limited to six fixed effort levels
  • Requires modern browser support for Web Components and Canvas 2D

README quick start

Claude Model Selector

A Claude-inspired effort picker as a zero-dependency Web Component.

Inspired by Claude desktop.

Demo

Open index.html in a browser, or include the component in your own page:




Listen for selection changes through the standard change event:

const selector = document.querySelector("claude-model-selector");

selector.addEventListener("change", (event) => {
  console.log(event.detail.index, event.detail.level);
});

Web Component API

AttributeTypeDefaultDescription
valuenumber 0–50Low, Medium, High, Extra, Max, or Ultracode
openbooleanfalseWhether the effort panel is open
disabledbooleanfalseDisables all interaction
  • value gets or sets the continuous slider position (snaps to an integer level on release).
  • level returns the current level name.
  • open / disabled mirror the attributes.
  • openPanel(), close(), and toggle() control the panel.
  • input emits while dragging or adjusting.
  • change emits when the selection settles on a level.

Both events include { index, level, value } in event.detail.

The component supports modern browsers with Web Components, Shadow DOM, Canvas 2D, and ResizeObserver.

Features

  • Six discrete effort levels: Low, Medium, High, Extra, Max, and Ultracode
  • Magnetic drag behavior with spring snapping
  • Animated Ultracode pixel field on the top tier
  • Keyboard support, focus styles, Escape / outside-click to close
  • prefers-reduced-motion support

CSS variables

claude-model-selector {
  --effort-accent: #8c73c9;
  --effort-track: #edeae8;
  --effort-surface: #ffffff;
  --effort-width: min(22.5rem, calc(100vw - 2rem));
}

Development

python3 -m http.server 4173
node --check JavaScript/claude-model-selector.js

Repository layout

JavaScript/                 JavaScript Web Component
index.html                  Browser demo

Disclaimer

This is an independent, Claude-inspired interface experiment. It is not affiliated with or endorsed by Anthropic.

License

MIT

Description

Claude-inspired effort picker as a zero-dependency Web Component (MIT)

Related repositories

Similar projects matched by category, topics, and programming language.

react
Featured
react GitHub avatar

react

React is a JavaScript library for building user interfaces with declarative, component-based, and cross-platform design.

Web DevelopmentFrontend Frameworks
246,741
tandpfun
Featured
tandpfun GitHub avatar

wardrobe

A GPT‑image powered app that extracts individual garment cutouts from photos, organizes them into a digital wardrobe, and generates modeled outfit previews.

JavaScript
1,570
mshumer
Featured
mshumer GitHub avatar

Claude-of-Duty

A browser-based first-person shooter built entirely with procedural generation and orchestrated AI agents, featuring 55k lines of Three.js/WebGL2 code and no art assets.

AI & Machine LearningAI Agents
1,234