Skip to content

MediaPicker

Surface for accepting media
import { MediaPicker } from 'degen'
name
type
default
description
accept
Accept
image/jpeg, image/png, image/webp, image/gif, video/mp4, video/ogg, video/webm
-
autoFocus
boolean
-
-
borderWidth
ConditionalStyle<Values<MapLeafNodes<{ '0px': string; '1px': string; '1.5px': string; '2px': string; '3px': string; '4px': string; '8px': string; }, CSSVarFunction>, { defaultClass: string; conditions: { ...; }; }>>
2px
-
compact
boolean
-
Show smaller input
cover
boolean
-
-
defaultValue
{ name?: string; type: string; url: string; }
-
-
disabled
boolean
-
-
error
ReactNode
-
-
height
ConditionalStyle<Values<MapLeafNodes<{ '0px': string; '1px': string; '2px': string; '4px': string; '6px': string; '8px': string; '10px': string; '12px': string; '14px': string; '16px': string; '20px': string; '24px': string; '28px': string; '32px': string; '36px': string; ... 31 more ...; none: string; }, CSSVarFunc...
-
-
id
string
-
-
label*
Required
ReactNode
-
-
labelTextColor
"textSecondary" | "textTertiary"
textSecondary
-
labelTextSize
ConditionalStyle<Values<{ inherit: "inherit"; headingOne: CSSVarFunction; headingTwo: CSSVarFunction; headingThree: CSSVarFunction; extraLarge: CSSVarFunction; ... 5 more ...; root: CSSVarFunction; }, { ...; }>>
compact ? 'base' : 'large'
-
maxSize
number
5
Size in megabytes
name
string
-
-
required
boolean
-
-
tabIndex
number
-
-
uploadProgress
number
-
-
uploaded
boolean
-
-
uploading
boolean
-
-
onBlur
FocusEventHandler<HTMLInputElement>
-
-
onError
(error: string) => void
-
-
onChange
(file: File) => void
-
-
onFocus
FocusEventHandler<HTMLInputElement>
-
-
onReset
() => void
-
-