Often you may want to include a dimmer in the lamp, so people can adjust the lighting levels to suit their use of the space. This used to be simple when lights were incandescent or halogen, but LED lamps cannot be used with a dimmer for incandescent lamps - the lamp may flicker or be damaged.

Also, not all LED bulbs can be dimmed - the ones that can will show a dimmable logo and label on their packaging. But you can use a non-dimmable bulb with a dimmable switch, just by setting the brightness to 100%.

For mains powered bulbs, there are two dimming technologies for LEDs: leading or trailing edge. Leading edge dimmers came first, but these sometimes make a buzzing sound when dimmed. The newer trailing edge dimmers don't suffer nearly as much from this. But some lights work better with one type of dimmer than the other. Better quality dimmers are "universal" - either the dimming mode can be switched manually, or some aim to select the best mode automatically.

Dimmers will typically be specified with two power ranges (in Watts). The higher range, for incandescent and halogen lamps, just requires that the power of the bulb(s) on the circuit is less than that of the dimmer. The lower range may be something like 4W - 20W, and it is important that the bulbs fall within this range, so if the range is 4W - 20W then a 3W bulb should not be used.

When selecting a dimmer, a soft start will improve bulb life - bulb brightness is ramped up over a second. And overload protection prevents damage to the dimmer if too powerful a bulb is inserted - generally switching the bulb off. Also, some lower quality dimmers don't actually switch the bulb off, but dim it to a level where there is no light but there is still a current flowing through the system.

LED bulbs may tend to flicker if dimmed down too far - few can go below 10%. Some dimmers simply avoid this by setting a conservative maximum dimming value - sometimes as high as 40%. Others have an adjustable screw or similar that you can use to optimise the dimming, but this is one more thing for the customer to have to understand.

Because the dimming characteristics vary with both the model of dimmer used, and the bulb model, it makes sense to recommend a bulb to be used with your lamp to get the behaviour you want. Some bulbs may dim evenly as the dimmer is adjusted, whereas others may dim much more quickly at the start or end; and some may dim down to a lower light level than others.

I have not seen a mains dimmer fitted in the bulb holder; they are included in the switch fitted into the cord. Very few of the dimmers available are designed to accommodate an earth wire, so if having a good choice of dimmer is important to you then you need to design the lamp to be double insulated.

Two things I haven't touched on here. You can get a number of "smart" bulbs that you can control from an app on your phone or via tools like Alexa - these are simple alternative bulbs, so have minimal effect on the lamp design. And, of course, you can build the transformer and dimmer into the lamp, but then this means a lot more complications, regulations, and electrical skills than I'm covering.