Skip to content

Domain Widget

The DomainProfileWidget is a React component that displays a .night domain’s profile, including avatar, bio, social links, and resolved addresses.

Terminal window
npm install @midnames/sdk
import { DomainProfileWidget } from "@midnames/sdk/react/DomainProfileWidget";
import "@midnames/sdk/styles.css";
function App() {
return <DomainProfileWidget fullDomain="facu.night" />;
}
PropTypeDescription
fullDomainstringThe .night domain to display
PropTypeDefaultDescription
publicDataProviderPublicDataProviderauto (preprod)Custom data provider
variant'full' | 'compact' | 'inline' | 'minimal''full'Layout variant
theme'light' | 'dark' | 'auto''auto'Color theme
showBannerbooleantrueShow banner image
showAvatarbooleantrueShow avatar
showBiobooleantrueShow bio text
showDomainInfobooleantrueShow address fields
showSocialLinksbooleantrueShow social link chips
showCopyButtonsbooleantrueShow copy-to-clipboard on addresses
showStatusbooleantrueShow registration status badge
fields('target' | 'owner' | 'resolver')[]['target', 'owner', 'resolver']Which address fields to display
customFieldsstring[][]Additional domain fields to display
borderRadius'none' | 'sm' | 'md' | 'lg''md'Card border radius
padding'none' | 'sm' | 'md' | 'lg''md'Card padding
classNamestringAdditional CSS class
renderActions(data: DomainProfileData | null) => ReactNodeRender custom actions below the profile
onError(error: MidnamesError) => voidError callback
onFieldClick(field: string, value: string) => voidField click callback
onCopySuccess(field: string, value: string) => voidCopy success callback
<DomainProfileWidget
fullDomain="facu.night"
variant="compact"
theme="dark"
/>
<DomainProfileWidget
fullDomain="facu.night"
variant="minimal"
fields={["target"]}
showBanner={false}
showSocialLinks={false}
/>
<DomainProfileWidget
fullDomain="facu.night"
customFields={["website", "github"]}
onCopySuccess={(field, value) => {
console.log(`Copied ${field}: ${value}`);
}}
onError={(err) => {
console.error("Widget error:", err.code, err.message);
}}
/>
<DomainProfileWidget
fullDomain="facu.night"
renderActions={(data) => (
<button onClick={() => window.open(`https://preprod.midnames.com/${data?.fullDomain}`)}>
View on Midnames
</button>
)}
/>

The SDK also exports a HolographicCard component with a holographic visual effect:

import { HolographicCard } from "@midnames/sdk/react/HolographicCard";
import "@midnames/sdk/holographic-card.css";

This component wraps content with an interactive holographic shine effect.