An electronic device comprising: a housing including an attachment surface; an electronic component detachably attached to the attachment surface; and a lever that is provided adjacent to the electronic component and is attached to the housing in a state of being rotatable about a rotation axis extending along the attachment surface, the lever being configured to detach the electronic component attached to the attachment surface by being rotated, wherein the lever includes a lever body that faces the electronic component in a first direction along which the rotation axis extends, the lever body extending from the rotation axis along a second direction that is a radial direction orthogonal to the rotation axis and along the attachment surface, the lever body includes: an end closer to the electronic component than to the rotation axis in the radial direction, and a recess that is open at the end and is recessed in a direction approaching the rotation axis along the radial direction, the electronic component includes: a surface facing the lever body in the first direction, and a protrusion that faces the recess in the first direction, protrudes in a direction toward the lever body from the surface facing the lever body, and is housed in the recess, and by rotating the lever in a direction away from the attachment surface, the protrusion moves in the recess in a direction away from the rotation axis. a housing including an attachment surface; an electronic component detachably attached to the attachment surface; and a lever that is provided adjacent to the electronic component and is attached to the housing in a state of being rotatable about a rotation axis extending along the attachment surface, the lever being configured to detach the electronic component attached to the attachment surface by being rotated, wherein the lever includes a lever body that faces the electronic component in a first direction along which the rotation axis extends, the lever body extending from the rotation axis along a second direction that is a radial direction orthogonal to the rotation axis and along the attachment surface, the lever body includes: an end closer to the electronic component than to the rotation axis in the radial direction, and a recess that is open at the end and is recessed in a direction approaching the rotation axis along the radial direction, an end closer to the electronic component than to the rotation axis in the radial direction, and a recess that is open at the end and is recessed in a direction approaching the rotation axis along the radial direction, the electronic component includes: a surface facing the lever body in the first direction, and a protrusion that faces the recess in the first direction, protrudes in a direction toward the lever body from the surface facing the lever body, and is housed in the recess, and a surface facing the lever body in the first direction, and a protrusion that faces the recess in the first direction, protrudes in a direction toward the lever body from the surface facing the lever body, and is housed in the recess, and by rotating the lever in a direction away from the attachment surface, the protrusion moves in the recess in a direction away from the rotation axis.