Home / File/ maxlength-selector.tsx — ui Source File

maxlength-selector.tsx — ui Source File

Architecture documentation for maxlength-selector.tsx, a tsx file in the ui codebase. 5 imports, 1 dependents.

File tsx ApplicationExhibition PlaygroundAI 5 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  d7dd18a6_6346_bd22_da4f_8310ad6201b3["maxlength-selector.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  d7dd18a6_6346_bd22_da4f_8310ad6201b3 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  9c463da6_747b_38dc_586b_cbb4873070b1["radix-ui"]
  d7dd18a6_6346_bd22_da4f_8310ad6201b3 --> 9c463da6_747b_38dc_586b_cbb4873070b1
  951c1a95_84b7_603d_3cc1_d98bfa6cfc50["hover-card"]
  d7dd18a6_6346_bd22_da4f_8310ad6201b3 --> 951c1a95_84b7_603d_3cc1_d98bfa6cfc50
  d752035b_6ed3_c6ef_e27c_eef51af9ec8d["label"]
  d7dd18a6_6346_bd22_da4f_8310ad6201b3 --> d752035b_6ed3_c6ef_e27c_eef51af9ec8d
  a726b95d_789e_b9ec_d440_20ff0f30482e["slider"]
  d7dd18a6_6346_bd22_da4f_8310ad6201b3 --> a726b95d_789e_b9ec_d440_20ff0f30482e
  5ee45142_aa10_ca73_456e_5946db3e53c3["page.tsx"]
  5ee45142_aa10_ca73_456e_5946db3e53c3 --> d7dd18a6_6346_bd22_da4f_8310ad6201b3
  style d7dd18a6_6346_bd22_da4f_8310ad6201b3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import type { Slider as SliderPrimitive } from "radix-ui"

import {
  HoverCard,
  HoverCardContent,
  HoverCardTrigger,
} from "@/registry/new-york-v4/ui/hover-card"
import { Label } from "@/registry/new-york-v4/ui/label"
import { Slider } from "@/registry/new-york-v4/ui/slider"

interface MaxLengthSelectorProps {
  defaultValue: React.ComponentProps<
    typeof SliderPrimitive.Root
  >["defaultValue"]
}

export function MaxLengthSelector({ defaultValue }: MaxLengthSelectorProps) {
  const [value, setValue] = React.useState(defaultValue)

  return (
    <div className="grid gap-2 pt-2">
      <HoverCard openDelay={200}>
        <HoverCardTrigger asChild>
          <div className="grid gap-4">
            <div className="flex items-center justify-between">
              <Label htmlFor="maxlength">Maximum Length</Label>
              <span className="text-muted-foreground hover:border-border w-12 rounded-md border border-transparent px-2 py-0.5 text-right text-sm">
                {value}
              </span>
            </div>
            <Slider
              id="maxlength"
              max={4000}
              defaultValue={value}
              step={10}
              onValueChange={setValue}
              aria-label="Maximum Length"
            />
          </div>
        </HoverCardTrigger>
        <HoverCardContent
          align="start"
          className="w-[260px] text-sm"
          side="left"
        >
          The maximum number of tokens to generate. Requests can use up to 2,048
          or 4,000 tokens, shared between prompt and completion. The exact limit
          varies by model.
        </HoverCardContent>
      </HoverCard>
    </div>
  )
}

Subdomains

Dependencies

  • hover-card
  • label
  • radix-ui
  • react
  • slider

Frequently Asked Questions

What does maxlength-selector.tsx do?
maxlength-selector.tsx is a source file in the ui codebase, written in tsx. It belongs to the ApplicationExhibition domain, PlaygroundAI subdomain.
What functions are defined in maxlength-selector.tsx?
maxlength-selector.tsx defines 1 function(s): MaxLengthSelector.
What does maxlength-selector.tsx depend on?
maxlength-selector.tsx imports 5 module(s): hover-card, label, radix-ui, react, slider.
What files import maxlength-selector.tsx?
maxlength-selector.tsx is imported by 1 file(s): page.tsx.
Where is maxlength-selector.tsx in the architecture?
maxlength-selector.tsx is located at apps/v4/app/(app)/examples/playground/components/maxlength-selector.tsx (domain: ApplicationExhibition, subdomain: PlaygroundAI, directory: apps/v4/app/(app)/examples/playground/components).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free