Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@vitus-labs/attrs

Latest version: v2.9.2

Overview

Last scanned
30 Nov 2026
Published
30 Nov 2026
npm package Publisher: vitbokisch
3 Stars
1 Forks
5 Versions
472 Downloads
TypeScript Repo language

Scan summary

@vitus-labs/attrs was last scanned on 30 Nov 2026 at version 2.9.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 5 versions; the latest 2 were published on 30 Nov 2026.
  • Findings: No rules fired in version 2.9.2.
  • Downloads: 472 downloads.

Versions

5 versions published
Versions and the rules that fired in each
VersionPublishedStatus
2.9.2 LATEST 30 Nov 2026 No rules fired
2.9.1 30 Nov 2026 No rules fired
2.9.0 4 Nov 2026 No rules fired
2.8.0 6 Oct 2026 Not shown
2.7.4 28 Aug 2026 Not shown

No rules fired in 2.9.2

Findings

Findings for v2.9.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 2.9.2; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@vitus-labs/attrs

Immutable, chainable default-props factory for React components.

npm license

Think of styled-components' .attrs() as a standalone, type-safe composition system. Define default props, swap base components, attach HOCs, and add metadata — all through an immutable chain where every call returns a new component.

Features

  • Immutable chaining — every method returns a new component, never mutates the original
  • Props merge order — priorityAttrs → attrs → explicit props (last wins), with full control over precedence
  • Prop filtering — strip internal props before they reach the DOM
  • HOC composition — named HOCs via .compose() with selective removal
  • Static metadata — attach and access custom data via .statics() / .meta
  • TypeScript inference — generics accumulate through the chain

Installation

npm install @vitus-labs/attrs

Quick Start

import attrs from '@vitus-labs/attrs'
import { Element } from '@vitus-labs/elements'

const Button = attrs({ name: 'Button', component: Element })
  .attrs({ tag: 'button', alignX: 'center', alignY: 'center' })

// Renders Element with tag="button", alignX="center", alignY="center"
<Button label="Click me" />

// Explicit props override attrs defaults
<Button tag="a" label="Link button" />

API

attrs(options)

Creates an attrs-enhanced component.

const Component = attrs({
  name: 'ComponentName',   // required — sets displayName
  component: BaseComponent, // required — the React component to wrap
})
.attrs(props | callback, options?)

Add default props. Can be called multiple times — defaults stack left-to-right.

// Object form — static defaults
Button.attrs({ tag: 'button' })

// Callback form — computed defaults based on current props
Button.attrs((props) => ({
  'aria-label': props.label,
}))

// Priority — resolved first, as the lowest layer: regular attrs and explicit props both override it
Button.attrs({ tag: 'button' }, { priority: true })

// Filter — remove props before passing to the underlying component
Button.attrs({}, { filter: ['internalFlag', 'variant'] })

Props merge order:

priorityAttrs → attrs → explicit props   (last wins)

Priority attrs are the lowest layer: they're resolved first, so regular .attrs() callbacks receive them as input (alongside explicit props) and can override them, and explicit props override both. Use priority attrs for base defaults that later attrs should be able to compute from.

.config(options)

Reconfigure the component. Returns a new component instance.

// Rename
Button.config({ name: 'PrimaryButton' })

// Swap the base component
Button.config({ component: AnotherComponent })

DEBUG is accepted by .config() but has no runtime effect in attrs: every non-production build already adds a data-attrs="<name>" attribute to the rendered element, with or without it. (In rocketstyle, DEBUG: true does enable per-render console logging.)

.compose(hocs)

Attach named Higher-Order Components. The last-declared HOC wraps outermost (renders first); the first-declared sits closest to the base component. The internal attrs HOC always stays outside every user HOC, so HOCs see the fully resolved props.

const Enhanced = Button.compose({
  withTheme: (Component) => (props) => (
    <ThemeProvider><Component {...props} /></ThemeProvider>
  ),
  withTracking: trackingHoc,
})

// Remove a specific HOC from the chain
const WithoutTracking = Enhanced.compose({ withTracking: null })
.statics(metadata)

Attach metadata accessible via the .meta property.

const Button = attrs({ name: 'Button', component: Element })
  .statics({ category: 'action', sizes: ['sm', 'md', 'lg'] })

Button.meta.category // => 'action'
Button.meta.sizes    // => ['sm', 'md', 'lg']
isAttrsComponent(value)

Runtime type guard.

import { isAttrsComponent } from '@vitus-labs/attrs'

isAttrsComponent(Button) // => true
isAttrsComponent('div')  // => false
getDefaultAttrs(props)

Retrieve the computed default props for a component, given the props the .attrs() callbacks should see (pass {} for none).

Button.getDefaultAttrs({}) // => { tag: 'button', alignX: 'center', ... }
Button.getDefaultAttrs({ label: 'Save' }) // callbacks receive `label`

TypeScript

Each .attrs<P>() call adds P to the component's prop types through MergeTypes:

const Base = attrs({ name: 'Base', component: Element })

const Typed = Base
  .attrs<{ variant: 'primary' | 'secondary' }>({ variant: 'primary' })
  .attrs<{ size?: 'sm' | 'md' | 'lg' }>({})

// Typed accepts: Element props + { variant, size? }
<Typed variant="secondary" size="lg" label="Hello" />

Access the accumulated types via type-only properties:

type AllProps = typeof Typed.$$types
type OriginalProps = typeof Typed.$$originTypes
type ExtendedProps = typeof Typed.$$extendedTypes

Peer Dependencies

Package Version
react >= 19
@vitus-labs/core *

License

MIT

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @vitus-labs/attrs

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

Frame 2085668439 (1)
Group 1261154229