/v1.0

WebsiteButton

WebsiteButton opens a given URL in a new browser tab (window.open) when clicked. It wraps the base Button component and defaults to the primary color with a globe icon. Use it on organization profiles, supplier cards, or any view that surfaces an external website link.

Props

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | url | string | Yes | — | URL to open in a new tab. Should be a fully qualified URL (e.g. https://example.com). | | title | string | No | "Visitar sitio" | Label displayed on the button. | | icon | string | No | "world" | Icon identifier shown before the label. | | color | string | No | "primary" | Theme color key or any CSS hex/named color. | | type | "clear" \| "outline" \| "solid" | No | "solid" | Visual variant of the button. | | size | "xs" \| "sm" \| "md" \| "lg" \| "xl" | No | "md" | Controls padding, font size, and icon size. | | borderRadius | number | No | 4 | Border radius in pixels. | | disabled | boolean | No | false | Disables interaction and reduces opacity. | | style | React.CSSProperties | No | — | Inline styles applied to the button. |

Usage

Basic

import WebsiteButton from '@/components/buttons/WebsiteButton';

export default function Example() {
  return (
    <WebsiteButton url="https://snapping.dev" />
  );
}

Custom label and outline style

import WebsiteButton from '@/components/buttons/WebsiteButton';

export default function SupplierCard({ supplier }: { supplier: { website: string } }) {
  return (
    <WebsiteButton
      url={supplier.website}
      title="Visit Website"
      type="outline"
      size="sm"
      borderRadius={8}
    />
  );
}