🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

custom-component-testing

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

custom-component-testing

Testing of new library with typescript

latest
npmnpm
Version
1.0.27
Version published
Maintainers
1
Created
Source

Autocomplete Component Example

import {Autocomplete} from 'custom-component-testing';

function App() {
  const recipes = [
    { id: 1, name: "Pasta" },
    { id: 2, name: "Pizza" },
    { id: 3, name: "Salad" }
  ];

  return (
    <Autocomplete
      options={recipes}
      label="Search for recipes..."
      name="search"
      onChange={(val) => console.log("Typed:", val)}
      onSelect={(val) => console.log("Selected:", val)}
    />
  );
}

Button Component Example

import {Button} from 'custom-component-testing';

function App() {
  return (
    <Button
      type="primary"
      size="large"
      startIcon="https://example.com/icon.png"
      onClick={() => console.log("Clicked!")}
      borderRadius="rounded"
      customDesign={{ backgroundColor: "#007bff" }}
    >
      Click Me
    </Button>
  );
}

Button Component Props

PropTypeDescriptionExample
typestring (optional)Button style type (e.g., "primary", "secondary", "disabled")."primary"
onClick() => void (optional)Callback when the button is clicked.() => console.log("Clicked!")
startIconstring (optional)Path or URL to an image displayed before the button text."/assets/arrow-left.svg"
endIconstring (optional)Path or URL to an image displayed after the button text."/assets/arrow-right.svg"
borderRadiusstring (optional)Controls border radius. Should match a class in index.module.css."normal" or "rounded"
customDesignReact.CSSProperties (optional)Inline custom styles applied to the button wrapper.{ backgroundColor: "#007bff" }
childrenReactNode (optional)Content/text inside the button."Submit" or <span>Save</span>
sizestring (optional)Adjusts size via CSS module class. Should match your class names."small", "normal", "large"

Autocomplete Component Props

PropTypeDescriptionExample
optionsRecipe[] (optional)Array of static suggestion objects, e.g., { id: number, name: string }.[ { id: 1, name: "Pizza" } ]
fetchOptions(query: string) => void (optional)Async function to fetch suggestions dynamically based on the input query.(query) => fetchData(query)
labelstringPlaceholder text displayed inside the input field."Search for recipes..."
namestringName attribute for the input field (used for forms)."search"
onChange(val?: string) => voidCallback triggered when the input value changes.(val) => console.log("Typed:", val)
onSelect(val?: string) => voidCallback triggered when a suggestion is selected from the dropdown.(val) => console.log("Selected:", val)

FAQs

Package last updated on 03 Jun 2025

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